using System;
using System.Collections.Generic;
using System.Text;
using DAL;
using Utility;
using DTO;

namespace BUS
{
  public   class tblichsuviBUS
    {
        public static tblichsuvicollection Get(string where,
         int pageindex,
         int pagesize,
         string orderby,
         string orderdirection,
         out int total)
        {
            tblichsuviDAL lichsuviDAL = new tblichsuviDAL();
            return lichsuviDAL .Get(where, pageindex, pagesize, orderby, orderdirection, out total);
        }
        public static tblichsuvicollection  GetAll()
        {
            int total = 0;
            Criteria cri = new Criteria();
            tblichsuviDAL  lichsuviDAL = new tblichsuviDAL ();
            return lichsuviDAL.Get(cri.Criter, 0, 0, lichsuvicolumns.magiaodich .ToString(), OrderDirection.ASC.ToString(), out total);
        }
        public static tblichsuvi GetByID(int iD)
        {
            int total = 0;
            Criteria cri = new Criteria();
            cri.add(Condition.AND, lichsuvicolumns.magiaodich .ToString(), Condition.EQUAL, iD);
            tblichsuviDAL  lichsuviDAL = new tblichsuviDAL();
            tblichsuvicollection  lichsuvicollection = lichsuviDAL.Get(cri.Criter,
                     0, 0, lichsuvicolumns.magiaodich .ToString(), OrderDirection.ASC.ToString(), out total);
            if (lichsuvicollection .Count > 0)
                return lichsuvicollection [0];
            return null;
        }
    }
}
